import request from '@/utils/request';

/**
 * 查询授权码列表
 *
 * @param {object} query
 */
export const listCode = (query: {
		pageNum: number; pageSize: number; authorizationkeyName: null; authorizationkeyPrefix: null; authorizationkeyType: null; authorizationkeyLength: null; printNumber: null; authorizationBegintime: null; authorizationEndtime:
			/**
			 * 查询授权码详细
			 *
			 * @param {string} id
			 */
			null; generateNumber: null; isDelete: null; createBy: null; createTime: null; updatedBy: null; updatedTime: null;
	}) => {
	return request({
		url: '/manage/code/list',
		method: 'get',
		params: query
	});
};

/**
 * 查询授权码详细
 *
 * @param {string} id
 */
export const getCode = (id: string) => {
	return request({
		url: '/manage/code/' + id,
		method: 'get'
	});
};

/**
 * 新增授权码
 *
 * @param {object} data
 */
export const addCode = (data: any) => {
	return request({
		url: '/manage/code/add',
		method: 'post',
		data: data
	});
};

/**
 *  修改授权码
 *
 * @param {object} data
 */
export const updateCode = (data: any) => {
	return request({
		url: '/manage/code/edit',
		method: 'put',
		data: data
	});
};

/**
 * 删除授权码
 *
 * @param {string} id
 */
export const delCode = (id: string) => {
	return request({
		url: '/manage/code/' + id,
		method: 'delete'
	});
};


